package cn.hchaojie.camp.javafx.part1;

import java.io.IOException;
import java.net.URL;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Calculator extends Application {

	@Override
	public void start(Stage stage) throws Exception {
		Scene scene = new Scene(createContents());
		
		stage.setScene(scene);
		stage.show();
	}
	
	// 在这里创建页面布局
	private Parent createContents() {
		Parent root = null;

		try {
			 root = FXMLLoader.load(this.getClass().getResource("calculator.fxml"));
			 
		} catch (IOException e) {
			e.printStackTrace();
		}

		return root;
	}

	public static void main(String[] args) {
		launch(args);
	}
}